package com.ssx.controller;

import com.ssx.mapper.GoodsMapper;
import com.ssx.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class hello {
    @Autowired
    GoodService goodService = null;
    @RequestMapping("/hello")
    public @ResponseBody
    String hello1(){
        return "hello";
    }
    @RequestMapping("/hellojsp")
    public String hellojsp(Model model){
        model.addAttribute("giao","啊啊啊啊啊");
        return "hello";
    }
    @RequestMapping("/findAllGoods")
    public String findAll(Model model){
        model.addAttribute("goodslist",goodService.findAll());
        return "/goods/goodsList";
    }
}
